package Top200;

import common.ListNode;

/**
 * @author zhangmin
 * @create 2022-02-26 14:14
 */
public class deleteDuplicates83 {
    public ListNode deleteDuplicates(ListNode head) {
        if (head==null||head.next==null) return head;
        ListNode cur=head;
        while (cur!=null&&cur.next!=null){
            if (cur.val==cur.next.val){
                cur.next=cur.next.next;
            }else {
                cur=cur.next;
            }
        }
        return head;
    }
}
